<!DOCTYPE html>
<html lang="en">
  <head>
      <meta charset="UTF-8">
      <title>ES6对象方法简写形式</title>
    <script type="text/javascript">

      //传统-对象方法定义/使用
      let monster = {
        name: "红孩儿",
        age: 100,
        sayHi: function () {
          console.log("信息：name=", this.name, " age=", this.age);
        }
      }
      monster.sayHi();

      // ES6风格 省略:function
      let monster2 = {
        name: "红孩儿",
        age: 900,
        sayHi() {
          console.log("信息：name=", this.name, " age=", this.age);
        }
      }
      monster2.sayHi();
    </script>
  </head>
  <body>

  </body>
</html>